package com.health.db.service.order;

import java.math.BigDecimal;
import java.util.List;

import com.health.db.model.MedicalTreatRecordWithBLOBs;
import com.health.db.model.RegisterOrder;
import com.health.db.model.RegisterOrderExample;
import com.health.db.model.RegisterOrderZProcess;
import com.health.db.model.UserAccountLedger;
import com.health.db.model.UserCardList;

public interface IRegisterOrderService {

	List<RegisterOrder> selectSimple(RegisterOrderExample example);
	 
	RegisterOrderExample insertOrder(RegisterOrder record,MedicalTreatRecordWithBLOBs patRecord) ;
	
	RegisterOrderExample updateOrder(RegisterOrder record,MedicalTreatRecordWithBLOBs patRecord) ;
	int updateOrder4Comment(RegisterOrder record) ;
	int updateOrderSelective(RegisterOrder record,int type) ;
	
	
	//payment an order,only for WeiXin and AliPay
	RegisterOrderExample updateOrder4Payment(RegisterOrder record,UserAccountLedger accountLedge,int accountType,String out_trade_no) ;
	
	//finish an order,transfer order fee to doctor's account
	RegisterOrderExample updateOrder4Finish(RegisterOrder  record,UserAccountLedger UserAccountLedger,int type) ;
	
	public RegisterOrderExample updateOrder4Finish(RegisterOrder record);
	
	
	RegisterOrder  selectSimpleSingleByOrderId(Long registerid);
	

	
	//accepting an order
	int updateOrder4Accept(RegisterOrder record ) ;
 
	//Wallet payment
	RegisterOrderExample updateOrder4WalletPayment(RegisterOrder record ) ;
	
	//Wallet and Card payment
	RegisterOrderExample updateOrder4WalletAndCardPayment(RegisterOrder record,UserCardList userCardList,String commont ,BigDecimal left) ;
	RegisterOrderExample updateOrder4WalletAndCardPayment(RegisterOrder record,List<UserCardList> userCardList,String commont ,BigDecimal left) ;
	
	RegisterOrderExample updateOrder4WalletPaymentDoc(RegisterOrder record ,String times) ;
	RegisterOrderExample updateOrder4WalletAndCardPaymentDoc(RegisterOrder record,UserCardList userCardList,String commont ,BigDecimal left) ;
	RegisterOrderExample updateOrder4WalletAndCardPaymentDoc(RegisterOrder record,List<UserCardList> userCardList,String commont ,BigDecimal left) ;
	
	RegisterOrderExample updateOrder4WalletAndCardRefound(RegisterOrder  record,UserCardList userCardList) ;
	RegisterOrderExample updateOrder4WalletAndCardRefound(RegisterOrder record,List<UserCardList> userCardList) ;
	
	RegisterOrderExample updateOrder4WalletRefound(RegisterOrder  record) ;
	//service card payment SINGLE
	RegisterOrderExample updateOrder4CardPayment(RegisterOrder record,UserCardList userCardList,String commont) ;
	
	//service card payment SINGLE
	RegisterOrderExample updateOrder4CardPaymentDoc(RegisterOrder record,UserCardList userCardList,String commont) ;
	RegisterOrderExample updateOrder4CardPaymentDoc(RegisterOrder record,List<UserCardList> userCardList ,String commont) ;

	//service card payment MULT
	RegisterOrderExample updateOrder4CardPayment(RegisterOrder record,List<UserCardList> userCardList ,String commont) ;
	RegisterOrderExample updateOrder4CardRefound(RegisterOrder record,List<UserCardList> userCardList) ;
	
	//RegisterOrderExample updateOrder4CardRefoundDoc(RegisterOrder record,List<UserCardList> userCardList) ;
	
	RegisterOrderExample updateOrder4CardRefound(RegisterOrder  record,UserCardList userCardList) ;
	
	RegisterOrderExample updateOrder4CardRefoundDoc(RegisterOrder  record,UserCardList userCardList,String commont) ;
	
	//cancle an order
	int updateOrder4Cancel(RegisterOrder record) ;
	
	//confirm an order
	int updateOrder4Confirm(RegisterOrder record) ;
	
	//delete an order
	int updateOrder4Delete(RegisterOrder record) ;
	
	//process timeout order data
	int processRunStatus1OrderTimeout(List<RegisterOrder> registerOrderTempList,String timeDefine) ;
	//process timeout order data
	int processRunStatus2OrderTimeout(List<RegisterOrder> registerOrderTempList,String timeDefine);
	//process timeout order data
	int processRunStatus3OrderTimeout(List<RegisterOrder> registerOrderTempList,String timeDefine) ;
	
	//process timeout order data
	int processRunStatus4OrderTimeout(List<RegisterOrder> registerOrderTempList,String timeDefine) ;
	
	//process timeout order data
	int processRunStatus7OrderTimeout(List<RegisterOrder> registerOrderTempList,String timeDefine) ;
	
	 //订单超时专用
	List<RegisterOrder> selectOrderState4Timeout(RegisterOrderExample example);
    
    //视屏处理接口
    public int updateOrder4Precess(RegisterOrder record,RegisterOrderZProcess registerOrderZProcess);

	//查医生最新的5条评价
	List<RegisterOrder> selectOrderEvaluateByDocId(Long docId);
	
	RegisterOrderExample insertHealthRecordOrder(RegisterOrder record) ;
	
    int updateOrder4Quit(RegisterOrder record );
	
}
